package com.skt.domain.ENUM;

public enum CostumeStatus {
    AVAILABLE((byte) 1, "可租"),
    RENTED((byte) 2, "已租"),
    MAINTENANCE((byte) 3, "维修中"),
    SCRAPPED((byte) 4, "报废");

    private final Byte code;
    private final String description;

    CostumeStatus(Byte code, String description) {
        this.code = code;
        this.description = description;
    }

    public static CostumeStatus fromCode(Byte code) {
        for (CostumeStatus status : values()) {
            if (status.code.equals(code)) {
                return status;
            }
        }
        throw new IllegalArgumentException("无效的服装状态码: " + code);
    }

    public Byte getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }
}